// 基础路径
const BASE_PATH = '/static/farm'

// 作物配置
export const CROPS = {
  carrot: {
    id: 'carrot',
    name: '胡萝卜',
    price: 10,
    growthTime: 60,
    harvestValue: 20,
    icon: '🥕'
  },
  tomato: {
    id: 'tomato',
    name: '番茄',
    price: 20,
    growthTime: 120,
    harvestValue: 40,
    icon: '🍅'
  },
  corn: {
    id: 'corn',
    name: '玉米',
    price: 30,
    growthTime: 180,
    harvestValue: 60,
    icon: '🌽'
  }
}

// 装饰物配置
export const DECORATIONS = {
  scarecrow: {
    id: 'scarecrow',
    name: '稻草人',
    price: 100,
    bonus: { type: 'protection', value: 0.2 },
    icon: '🎎'
  },
  wateringCan: {
    id: 'wateringCan',
    name: '浇水壶',
    price: 150,
    bonus: { type: 'growth', value: 0.3 },
    icon: '💧'
  },
  fertilizer: {
    id: 'fertilizer',
    name: '肥料',
    price: 200,
    bonus: { type: 'value', value: 0.4 },
    icon: '💊'
  }
}

// 地块解锁成本
export const PLOT_UNLOCK_COSTS = [500, 1000, 2000, 3000, 5000, 8000]

// 天气配置
export const WEATHER_TYPES = {
  sun: {
    id: 'sun',
    name: '晴天',
    image: `${BASE_PATH}/weather/sun.png`,
    duration: [120, 300], // 2-5分钟
    probability: 0.4
  },
  cloud: {
    id: 'cloud',
    name: '多云',
    image: `${BASE_PATH}/weather/cloud.png`,
    duration: [60, 180],
    probability: 0.3
  },
  rain: {
    id: 'rain',
    name: '雨天',
    image: `${BASE_PATH}/weather/rain.png`,
    duration: [60, 120],
    probability: 0.2
  },
  storm: {
    id: 'storm',
    name: '暴风雨',
    image: `${BASE_PATH}/weather/storm.png`,
    duration: [30, 60],
    probability: 0.1
  }
}

export const LEVEL_CONFIG = {
  baseXP: 100,
  xpMultiplier: 1.5,
  maxLevel: 50,
  rewards: {
    plotUnlock: [5, 10, 15, 20],
    decorationUnlock: [3, 8, 13, 18],
    coinBonus: [100, 200, 500, 1000]
  }
}

export const calculateLevelXP = (level) => {
  return Math.floor(LEVEL_CONFIG.baseXP * Math.pow(LEVEL_CONFIG.xpMultiplier, level - 1))
} 